package com.Advance.final_;
//编写程序，计算圆的面积，圆周率为3.14，展现final中赋值3个方式的细节
public class final_test {
    public static void main(String[] args) {
        Circle circle = new Circle(5);
        System.out.println(circle.calcArea());
    }
}
class Circle{
    private  double radius = 3;
//    private final double PI = 3.14;
    private final double PI ;

//    {
//        PI = 3.14;
//    }
    public Circle(double radius) {
        this.radius = radius;
        PI = 3.14;
    }
    public double calcArea() {
        return PI * radius * radius;
    }

}

